import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty } from 'class-validator';

export class CreateUserDto {
  @IsNotEmpty({ message: '用户名必填' })
  @ApiProperty({ description: '用户名', required: true, default: 'admin' })
  readonly username: string;

  @IsNotEmpty({ message: '密码必填' })
  @ApiProperty({ description: '密码', required: true, default: '123456' })
  readonly password: string;

  /*  @IsNotEmpty({ message: '可为空' })
  @ApiProperty({ description: 'token',required: false ,default:'333' })
  readonly token ?: string*/

  @IsNotEmpty({ message: '可为空' })
  @ApiProperty({ description: 'email', required: false, default: 'xxx@qq.com' })
  readonly email?: string;
}
